//
//  StoresUserEditorViewController.m
//  SameWorld(merchant)
//
//  Created by 李小朋 on 2017/3/31.
//  Copyright © 2017年 杨旭. All rights reserved.
//

#import "StoresUserEditorViewController.h"

@interface StoresUserEditorViewController ()

@end

@implementation StoresUserEditorViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.title = @"修改信息";
    
    [self createUI];
}

- (void)createUI {
    
//    UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithTitle:@"完成" style:(UIBarButtonItemStylePlain) target:self action:@selector(rightItem:)];
//    self.navigationItem.rightBarButtonItem = rightItem;
    
    
    UIView *backView = [[UIView alloc] initWithFrame:self.view.bounds];
    backView.backgroundColor = [UIColor colorWithHexString:@"#f2f2f2"];
    [self.view addSubview:backView];
    
    UIView *contentView = [[UIView alloc] initWithFrame:(CGRectMake(0, 8, size_width, 44))];
    contentView.backgroundColor = [UIColor whiteColor];
    [backView addSubview:contentView];
    
    UIImageView *image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",self.userImage]]];
    image.frame = CGRectMake(12, (contentView.frame.size.height - 12)/2, 12, 12);
    [contentView addSubview:image];
    
    UILabel *name = [UILabel setLabelWithText:self.userTitle fontSize:12 color:color_textOne];
    name.frame = CGRectMake(30, (contentView.frame.size.height - 20)/2, 60, 20);
    [contentView addSubview:name];
    
    // 用户信息
    UITextField *userInformation = [[UITextField alloc] initWithFrame:(CGRectMake(name.frame.size.width + name.frame.origin.x , 0, contentView.frame.size.width - 100, 44))];
    userInformation.clearButtonMode = UITextFieldViewModeAlways;
    userInformation.font = [UIFont systemFontOfSize:12];
    [contentView addSubview:userInformation];
    
    UIButton *submitBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    submitBtn.frame = CGRectMake((size_width - 296)/2, contentView.frame.size.height + 40, 296, 40);
    submitBtn.backgroundColor = [UIColor colorWithHexString:@"#ff9900"];
    [submitBtn setTitle:@"提交" forState:(UIControlStateNormal)];
    [submitBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
    submitBtn.layer.masksToBounds = YES;
    submitBtn.layer.cornerRadius = 5;
    [submitBtn addTarget:self action:@selector(submitBtnClicked:) forControlEvents:(UIControlEventTouchUpInside)];
    [backView addSubview:submitBtn];
}

#pragma mark - 提交按钮
- (void)submitBtnClicked:(UIButton *)sender {
    NSLog(@"提交");
}

@end
